package sizeyunsuan;

/**
 * Created by 春旺 on 2017/5/11.
 */
import java.io.*;
public class OutFile {
    public String[] InRandom()throws IOException
    {
        //读入文件
        FileReader fr = new FileReader("problem.txt");
        //确定文件行数
        LineNumberReader reader = new LineNumberReader(new FileReader("problem.txt"));
        int cnt = 0;
        String lineRead = "";
        while ((lineRead = reader.readLine()) != null) {

        cnt = reader.getLineNumber();


    }
    String formula[]=new String[cnt];
    BufferedReader buff = new BufferedReader(fr);
        //按行读取文件。并加入到数组中。

        while (lineRead!= null){
            int i = 0;

            formula[i] = buff.readLine();
            i++;
        }
        return formula;

    }

}
